home *** CD-ROM | disk | FTP | other *** search
/ Apple II Magazines (PO) / Nibble Volume 09, No. 12 (1988-12)(MicroSPARC)(Side A)[a].zip / Nibble Volume 09, No. 12 (1988-12)(MicroSPARC)(Side A)[a].po / HREXP.T.txt < prev    next >
Text File  |  1996-12-24  |  2KB  |  67 lines

  1. **************************************************
  2. *                                                *
  3. *               HREXP Source Code                *
  4. *                                                *
  5. *             by S. Scott Zimmerman              *
  6. *              Copyright (c) 1988                *
  7. *              by MicroSPARC, Inc                *
  8. *              Concord, MA  01742                *
  9. *                                                *
  10. *               Merlin Assembler                 *
  11. *                                                *
  12. **************************************************
  13.  
  14.  ORG $300 ;Relocatable
  15.  
  16. **************************************************
  17. *  EQUates:                                      *
  18. **************************************************
  19.  
  20. HRPTR EQU $00 ;Hi-res screen pointer
  21. SCRNNUM EQU $06 ;0 = HR pg 1, 32 = pg 2
  22. COMPTR EQU $1E ;Compact pict pointer
  23. ENDBYT EQU $80 ;#$80 ends 'on' bytes
  24.  
  25. **************************************************
  26. *  Macro definition:                             *
  27. **************************************************
  28.  
  29. INCR MAC ;16-Bit increment
  30.  INC :A
  31.  BNE ]A
  32.  INC :A+1
  33. ]A EMC
  34.  
  35. **************************************************
  36. *  Program start:                                *
  37. **************************************************
  38.  
  39. ADDRESS LDY #0 ;Zero the index
  40.  LDA (COMPTR),Y ;Get compact byte
  41.  INCR COMPTR ;Point to next comp byt
  42.  STA HRPTR ;Set hi-res address
  43.  CLC ;Prepare to add
  44.  LDA (COMPTR),Y ;Get HOB from compact
  45.  INCR COMPTR ;Point to next comp byt
  46.  ADC SCRNNUM ;Add HR page (0 or 32)
  47.  STA HRPTR+1 ;Set HOB
  48.  
  49. BYTVAL LDA (COMPTR),Y ;Get HR byte value
  50.  INCR COMPTR ;Point to next comp byt
  51.  CMP #ENDBYT ;End of string?
  52.  BEQ TABLEND ;Yes, end of string
  53.  NOP ;To erase, put $A9 here
  54.  NOP ; and $00 here
  55.  STA (HRPTR),Y ;Put pixels on screen
  56.  INCR HRPTR ;Point to next HR byte
  57.  CLV ;To force branch
  58.  BVC BYTVAL ;Always branch
  59. TABLEND LDA (COMPTR),Y ;Three $80's in a row?
  60.  CMP #ENDBYT
  61.  BNE ADDRESS ;No, so proceed
  62.  INY ;Go to next compact byt
  63.  LDA (COMPTR),Y
  64.  CMP #ENDBYT
  65.  BNE ADDRESS ;No, so proceed
  66.  RTS ;Yes, so done
  67.